#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include "stringmodel.h"
#include <QtQml>
#include <QList>
#include <QDebug>

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    qmlRegisterType<StringModel>("qt.model.test", 1, 0, "StringModel");

    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:///main.qml")));

    QList<QObject*> rootItems = engine.rootObjects();

//    QObject* root = NULL;
//    int count = rootItems.size();
//    for (int i = 0; i < count; ++i){
//        if (rootItems.at(i)->objectName() == "rootItem"){
//            root = rootItems.at(i);
//            break;
//        }
//    }

    return app.exec();
}
